package com.intct.hbase.namespace;

import com.intct.util.ConnectionHBaseUtils;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;

import java.io.IOException;

/**
 * @author gufg
 * @since 2025/6/12
 */
public class DropNamespace {
    public static void main(String[] args) throws IOException {
        // 创建HBase连接
        Connection connection = ConnectionHBaseUtils.getConnection();

        // 获取admin实例
        Admin admin = connection.getAdmin();

        // 删除命名
        try {
            admin.deleteNamespace("intct_80_api");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            // 关闭资源
            if (admin != null) {
                admin.close();
            }
        }
    }
}
